import { getChannelList } from "../../api/channel"
import { CHANNEL_SET_LIST, CHANNEL_SET_CURRENT } from './actionType'

export const getChannelListCreator = () => {
    return async (dispatch) => {
        const { data } = await getChannelList()
        dispatch({ type: CHANNEL_SET_LIST, payload: data.channels })
    }
}
export const setCurrent = (id) => {
    return {
        type: CHANNEL_SET_CURRENT,
        payload: id,
    }
}
